// TOWN DIALOGUE SCRIPT
//    Town 160: Spineridge

begintalkscript;

variables;

short i,j,k,r1,choice;

begintalknode;
	tag = 1;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "Spineridge is full of refugees. They fled from the northeast. They're an exhausted, hungry lot.";
	text2 = "None of them want to talk to you. You don't look trustworthy to them.";


// Malka

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Malka";
	text1 = "This young woman is busy nursing a small child. She motions for you to wait for a moment. When the child is fed, she sets it on the table and turns to you.";
	text2 = "She nods. _Greetings, adventurers. I am Malka._";
	text5 = "Malka starts to speak with you, but then her child begins to cry. With a sigh, she returns it to her breast. _She can't stand to be let alone for a minute. Now, you were saying?_";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Greetings. What are you doing in this inn?_";
	text1 = "She sighs. _I am fleeing Gale._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Why did you flee?_";
	text1 = "She looks down at her baby. _We have abandoned our home. It was painful and difficult, but what can one do? We have our child to look after._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_Did anyone flee with you?_";
	text1 = "_Yes. Vairlas and I left because everything in Gale is insane. The golems, the herb, the madness of our mayor. It was all too much._";
	text3 = "_Yes. Vairlas and I left because everything in Gale is insane. The golems, the herb, the madness of our mayor. It was all too much. Even now that the golems are gone, we don't want to return. I hear that the madness of the leaders has not improved._";
	action = DEP_ON_SDF 308 0 0;

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_What's going on with the golems?_";
	text1 = "_Vairlas knows much of the golems. You should ask him._";

begintalknode;
	state = 4;
	nextstate = 5;
	question = "_Herb problem?_";
	text1 = "_Here we are. Valorim is attacked on all sides, danger is everywhere, so what do people do? Kill their minds with these strange potions. Gale is filled with twitching, drooling herb addicts. Even some soldiers use the stuff!_";

begintalknode;
	state = 5;
	nextstate = 4;
	question = "_What effect does the herb have on soldiers?_";
	text1 = "_The herb makes them stronger. They can still fight even after taking wounds that would normally kill them._ She shakes her head. _The twitching and drooling comes later._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_What's wrong with the mayor?_";
	text1 = "She looks nervous, and looks around. _Forget I said anything. Mayor Rali has a long reach._";

begintalknode;
	state = 1;
	nextstate = 6;
	question = "_What's your child's name?_";
	text1 = "_Her name is Cordelia._ She leans over to kiss her on the forehead. She continues to suckle happily.";

begintalknode;
	state = 6;
	nextstate = -1;
	question = "_She seems to have a healthy appetite._";
	text1 = "_You don't know the half of it. She's just this bottomless pit, into which I throw milk._";

begintalknode;
	state = 6;
	nextstate = -1;
	condition = gf(160,11) == 0;
	question = "_Cordelia? Isn't that a weird name?_";
	text1 = "_Isn't that a stupid question?_";
	action = SET_SDF 160 11 1;

begintalknode;
	state = 6;
	nextstate = -1;
	condition = gf(160,11) == 0;
	question = "_That's a lovely name._";
	text1 = "_Thank you. I agree._";
	action = SET_SDF 160 11 1;

// Vairlas

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Vairlas";
	text1 = "This man's robes are stained from heavy traveling. His pack strains to contain all of the scrolls and books inside it. _Ah ... I can recognize a fellow migrant. I am Vairlas._";
	text5 = "Vairlas smiles and takes a drink from his ale. You notice that he never looks away from his sack of books.";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_What is your profession?_";
	text1 = "_I am a sage. Unfortunately, there are few services I can provide now._";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_Why can you provide only a few services?_";
	text1 = "_My wife, Malka, and I are on the road now, trying to escape the golems._";

begintalknode;
	state = 31;
	nextstate = 32;
	question = "_What do you know of the golems?_";
	text1 = "He suddenly looks interested. _You wish to know of the golems? I was studying them intensely before we fled. You can purchase all I know of them, for only 50 coins._";
	text3 = "_I knew a fair amount. Now the golems are gone. I am glad of it, but I have no more useful information to sell._";
	action = DEP_ON_SDF 308 0 0;

begintalknode;
	state = 32;
	nextstate = 29;
	condition = gf(308,0) == 0 && gf(160,10) == 0;
	question = "_I'd rather not buy the information._";
	text1 = "_Fair enough. I will try to ply my trade elsewhere._";

begintalknode;
	state = 32;
	nextstate = 33;
	condition = gf(308,0) == 0 && coins_amount() >= 50 && gf(160,10) == 0;
	question = "_Ok._ Pay 50 coins.";
	text1 = "He takes your coins. _Thanks. This will be a great help. Let's see. Golems are magically animated statues, very strong and resilient to damage. Gale is currently under constant attack by groups of them. This is, as you can imagine, incredibly bizarre._";
	code =
		sf(160,10,1);
		change_coins(-50);
	break;

begintalknode;
	state = 32;
	nextstate = 33;
	condition = gf(160,10) > 0;
	question = "_Could you remind me what you said about the golems?_";
	text1 = "_I would be happy to. Golems are magically animated statues, very strong and resilient to damage. Gale is currently under constant attack by groups of them. This is, as you can imagine, incredibly bizarre._";

begintalknode;
	state = 33;
	nextstate = 34;
	condition = gf(160,10) >= 1;
	question = "_What's so bizarre?_";
	text1 = "_A single golem is normally extremely difficult to make, and yet here we are, being set upon by large groups of them. Someone bearing great magical power must be responsible._";
	text2 = "_I can also tell you there are several varieties of them and that we know the direction they come from._";

begintalknode;
	state = 34;
	nextstate = 35;
	question = "_What are the varieties?_";
	text1 = "_I know of four. One has arms ending in blades. Two have fire and cold bolts respectively. And a fourth can shoot massive bolts of energy._";
	text2 = "_Also, some soldiers say they have seen golems flying overhead, powerful gray creatures with a demonic aspect. I take their reports seriously._";

begintalknode;
	state = 35;
	nextstate = 34;
	question = "_How can you take reports like that seriously?_";
	text1 = "_I have heard of them from four different soldiers, who claimed to see them personally._";

begintalknode;
	state = 34;
	nextstate = -1;
	question = "_What direction are they coming from?_";
	text1 = "_The golems attacking Gale come from a ways to the north. From north of the town of Tevrono. The exact source of the attackers, however, nobody has been able to determine._";

begintalknode;
	state = 29;
	nextstate = 36;
	question = "_That's quite a few books you have there._";
	text1 = "_Yes. And they are very heavy, I can tell you._";

begintalknode;
	state = 36;
	nextstate = -1;
	question = "_What are they about?_";
	text1 = "_Little that would help an adventurer. No grimoires, no powerful rituals. Just encyclopedias. Bestiaries. Dictionaries. Things for the student, not the warrior._";


// McClain

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "McClain";
	text1 = "The innkeeper is incredibly busy. He's cooking the next meal, serving drinks, and keeping everything clean, all simultaneously. _I'm McClain,_ he pants, as he moves past you.";
	text5 = "McClain continues his constant labors, straining to keep up with the demands of the refugees clogging his inn. He makes eye contact with you for a moment. He's listening to you.";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_What can I get here?_";
	text1 = "_The inn is full. Keeps me busy. I have a couple pallets you can rent in a store room. Only twelve coins. It's a mess back there, though. Last people in there left without paying._";
	text2 = "_I also have some beer, 4 coins for a round. Popular item, that beer._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_Why are you full?_";
	text1 = "_Everyone's fleeing Gale and stopping here. Can you blame them?_";

begintalknode;
	state = 57;
	nextstate = -1;
	condition = coins_amount() >= 12;
	question = "_I guess I'll take the pallets._";
	text1 = "_Down the wall to the west. Used to be a closet. Still smells like it. You can't miss it._ You find your way to the cramped little room. Sure enough, the previous occupants left the floor scattered with dirty laundry.";
	action = END_TALK;	
	code =
		revive_party();
		change_coins(-12);
		relocate_char(get_pc_id(0),15,20,FALSE);
		relocate_char(get_pc_id(1),16,20,FALSE);
		relocate_char(get_pc_id(2),16,21,FALSE);
		relocate_char(get_pc_id(3),15,21,FALSE);
	break;

begintalknode;
	state = 57;
	nextstate = -1;
	condition = coins_amount() >= 4;
	question = "_A round of beers please._";
	text1 = "He quickly serves up some mugs of beer. It's weak, but it has a good flavor. _Brewed right here. When I have the time._";
	text2 = "You spend some time chatting with the refugees. They're a sad, friendly lot, eager to share tales of the horrible damage caused by the golems.";
	text3 = "Some of them mention that they should have gone to Tevrono, to the north. That is where the most effective warriors against the golems are based.";
	code =
		force_char_status(30000,1,20);
		change_coins(-4);
	break;

begintalknode;
	state = 57;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "He starts to respond, but a refugee shouts an order at him. He moves on without a word.";
	action = END_TALK;
	
// Alzon

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 85;
	question = "Alzon";
	text1 = "You meet one of the Empire's seemingly endless supply of bureaucrats. She has the haggard look indicative of long periods of much work and no sleep. She shuffles idly through a thick stack of papers.";
	text2 = "_Another courier? Fine, I suppose. I am Alzon,_ she says with a sigh.";
	text5 = "Alzon looks up at you, eager for a distraction from all of the paperwork.";
	action = INTRO;

begintalknode;
	state = 85;
	nextstate = 86;
	question = "_What responsibilities do you have?_";
	text1 = "_I am in charge of supply for large parts of Monoroe Province's internal structure. In addition, I am the jobs dispatcher. If you would like some courier work, let me know._";

begintalknode;
	state = 86;
	nextstate = -1;
	question = "_How fares Monoroe Province?_";
	text1 = "_If you wish an opinion on anything political, you've come to the wrong place. All of our leaders are infinitely wise and strong. And the punishments for those who say otherwise are just in their severity. All right?_";




begintalknode;
	state = 86;
	nextstate = 87;
	question = "_Are there enough supplies to go around?_";
	text1 = "_It seems there is nothing we are not short of these days. If you have any goods you could sell us, it would be a great help. I have little you can buy, just some food and traveling supplies._";

begintalknode;
	state = 87;
	nextstate = -1;
	question = "_Let's trade._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Alzon's Goods","Immensely relieved, Alzon offers a few random items she is free to sell.",109,6,3);
	break;
	
begintalknode;
	state = 87;
	nextstate = -1;
	condition = 1;
	question = "_I would like to sell something._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode;
	state = 87;
	nextstate = 85;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_All right. What do you want, then?_";
	
begintalknode;
	state = 85;
	nextstate = 88;
	question = "_Even in times like this, you need to do paperwork?_";
	text1 = "_Of course. It's even more important now, since I've lost contact with my superiors. Eventually, they will emerge from Blackcrag, and they will want to know what has been happening. And I will be able to tell them._";
	text2 = "_It is difficult, though. I haven't been able to get the information I need for some time._";
	code =
		if (gf(160,9) > 1)
			rs(2);
	break;
	
begintalknode;
	state = 88;
	nextstate = -1;
	question = "_What is Blackcrag?_";
	text1 = "_Blackcrag Fortress. Northwest of here. It is the gateway between Valorim and the rest of the world. If anyone, such as me, wanted to make contact with the Empire, that would be the place to go._";
	text2 = "_Unfortunately, it's sealed up, and I don't know a way in._";

begintalknode;
	state = 88;
	nextstate = -1;
	condition = gf(160,9) <= 1;
	question = "_What information do you need?_";
	text1 = "_Maps. Up to date maps. I need a full, current map of Valorim, so that I can properly direct supplies and couriers._";
	text2 = "_If someone could show me such a map, it would be incredibly valuable._";
	action = SET_SDF 160 9 1;
	code =
		toggle_quest(79,1);
	break;
	
begintalknode;
	state = 85;
	nextstate = -1;
	condition = gf(160,9) == 1 && gf(309,19) && gf(309,20) && gf(309,21) && gf(309,22) && gf(309,23);
	question = "_I have a full map of Valorim._ Show her.";
	code =
		run_hardcode(47);
	break;

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_I'm interested in a courier job._";
	text1 = "_The job board is outside. Feel free to consult it._";
	action = END_TALK;
